package com.hinnotek.warehouse.ui.fragment

import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import android.widget.ImageView
import com.xuexiang.xui.widget.imageview.preview.ui.BasePhotoFragment
import timber.log.Timber
import kotlin.math.roundToInt

open class PhotoFragment : BasePhotoFragment() {

 
/*
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        if (mImageView.scaleType != ImageView.ScaleType.FIT_XY) {
            mImageView.scaleType = ImageView.ScaleType.FIT_XY;
        }
        val wm = mImageView.context
            .getSystemService(Context.WINDOW_SERVICE) as WindowManager
        val width = wm.defaultDisplay.width;
        val params = mImageView.layoutParams;
        params.width = width;
        val vw = mImageView.width - mImageView.paddingLeft - mImageView.paddingRight;

        val resource = mImageView.drawable as BitmapDrawable

        val scale = vw.toFloat() / resource.intrinsicWidth.toFloat()
        val vh = (resource.intrinsicHeight * scale).roundToInt();
        params.height = vh + mImageView.paddingTop + mImageView.paddingBottom
        mImageView.layoutParams = params;
        mImageView.setImageDrawable(resource)
        super.onViewCreated(view, savedInstanceState)
    }*/
}